<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>最大公约数</title>
    <script>
      /* 欧几里得算法,辗转相处 */
      function gcd(n1, n2) {
        let mod = 0
        while (n2 != 0) {
          mod = n1 % n2
          n1 = n2
          n2 = mod
        }
        return n1
      }

      /* 最小公倍数 */
      function lcm(n1, n2) {
        return (n1 * n2) / gcd(n1, n2)
      }
    </script>
  </head>
  <body></body>
</html>
